package com.ss.android.article.base.feature.detail2.a.c;

import android.view.View;

import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.detail.model.PhoneAdsData;
import com.ss.android.article.browser.R;
import com.ss.android.b.a.BaseAdsData;
import com.ss.android.common.ad.MobAdClickCombiner;
import com.ss.android.common.lib.MobClickCombiner;
import com.ss.android.common.dialog.AlertDialog;
import com.ss.android.common.util.NetworkUtils;

final class u implements View.OnClickListener {
    private final DetailAdVideoLayout b;
    private final BaseAdsData a;

    u(DetailAdVideoLayout arg1, BaseAdsData arg2) {
        this.b = arg1;
        this.a= arg2;
    }

    public final void onClick(View arg13) {
        long v10 = 0;
        if(!NetworkUtils.isNetworkAvailable(this.b.getContext())) {
            android.support.design.a.showImageToast(this.b.getContext(), R.string.net_unvailable, 0);
        }
        else {
            if((NetworkUtils.isWifi(this.b.getContext())) || (AppData.getInstance().userAllowUseMobileNet)) {
                this.b.b();
            }
            else {
                DetailAdVideoLayout v0 = this.b;
                AlertDialog.Builder v8 =  com.ss.android.j.b.createDialogBuilder(v0.getContext());
                long v4 = v0.f == null ? v10 : v0.f.groupId;
                v8.setMessage(com.ss.android.article.browser.R.string.video_mobile_play_dlg_content);
                v8.setPositiveButton(com.ss.android.article.browser.R.string.video_mobile_play, new x(v0, v4));
                v8.setNegativeButton(com.ss.android.article.browser.R.string.video_mobile_stop, new y(v0, v4));
                MobClickCombiner.onEvent(v0.getContext(), "video", "net_alert_show", v4, v0.d);
                v8.setCancelable(false);
                v8.show();
            }

            String v2 = (this.a instanceof PhoneAdsData) ? "detail_call" : "detail_ad";
            MobAdClickCombiner.onAdEvent(this.b.getContext(), v2, "click", this.b.d, v10, this.b.h, 1);
        }
    }
}

